package com.yunweiweishi.xuhuanpaltform.yuhuan_app.service.imp;

import com.yunweiweishi.xuhuanpaltform.yuhuan_app.dao.EquipmentPartDao;
import com.yunweiweishi.xuhuanpaltform.yuhuan_app.pojo.EquipmentPart;
import com.yunweiweishi.xuhuanpaltform.yuhuan_app.service.EquipmentPartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class EquipmentPartServiceImpl  implements EquipmentPartService {




    @Autowired
    private EquipmentPartDao equipmentPartDao;

    @Override
    public void addEquipmentPart(EquipmentPart equipmentPart) {

        equipmentPartDao.save(equipmentPart);
    }

    @Override
    public void updateEquipmentPart(EquipmentPart equipmentPart) {
        equipmentPartDao.save(equipmentPart);
    }

    @Override
    public void deleteEquipmentPartById(Long id) {

        equipmentPartDao.deleteById(id);
    }

    @Override
    public EquipmentPart findByEquipmentPartName(String equipmentPartName) {
        return equipmentPartDao.findByEquipmentPartName(equipmentPartName);
    }

}
